package mensch;

import java.util.ArrayList;
import java.util.List;

public class Player {
	
	private String name;
	private List<Pawn> pawns;
	private int playerID;
	private int firstFieldIndex;
	private int lastFieldIndex;
	private int firstGoalIndex;
	private int lastGoalIndex;
	private int firstHomeIndex;
	private int progress = 0;
	
	/**
	 * Number of pawns per player. For UE2: 1
	 */
	private int numberOfPawns = 1;
	
	public Player(String name, int playerID) {
		this.name = name;
		this.playerID = playerID;
		this.firstFieldIndex = playerID*10;
		this.lastFieldIndex = firstFieldIndex + 39;
		this.firstGoalIndex = 56 + playerID*4;
		this.lastGoalIndex = firstGoalIndex + 3;
		this.firstHomeIndex = 40 + playerID*4;
		
		pawns = new ArrayList<Pawn>();
		for (int i = 0; i < numberOfPawns; i++) {
			pawns.add(new Pawn(this));
		}
	}
	
	public String getName() {
		return name;
	}
	
	public List<Pawn> getPawns() {
		return pawns;
	}
	
	public int getPlayerID() {
		return playerID;
	}
	
	public int getFirstFieldIndex() {
		return firstFieldIndex;
	}
	
	public int getLastFieldIndex() {
		return lastFieldIndex;
	}
	
	public int getFirstGoalIndex() {
		return firstGoalIndex;
	}
	
	public int getLastGoalIndex() {
		return lastGoalIndex;
	}
	
	public int getFirstHomeIndex() {
		return firstHomeIndex;
	}
	
	public int getProgress() {
		return progress;
	}
	
	public void setProgress(int progress) {
		this.progress = progress;
	}
}
